{{#index}}
<div class="main-content">
    <div class="div-title">权限列表</div>
    <div class="action-div">
        <button class="btn btn-sm btn-primary e-add sysPermission_add">新增</button>
    </div>
    <div class="dd nestable-show">
        <js>var forOut=function(treeData,level)</js>
        <js-code>
            <js>if(treeData==null||treeData.length==0)</js>
            <js-code>
                <js>return;</js>
            </js-code>
            <ol class="dd-list">
                <js>var currentLevel=level;</js>
                <js>for(var i=0;i< treeData.length;i++)
                </js>
                <js-code>
                    <li class="dd-item sysPermission_sort_li nes-level-${currentLevel} nes-init" data-id="${treeData[i].id}">
                        <div class="dd-handle">
                            <div class="nestable-btn-div">
                                <button class="e-add e-stop-mousedown sysPermission_add" data-parent-id="${treeData[i].id}">新增</button>
                                <button class="e-copy e-stop-mousedown sysPermission_copy" content="${treeData[i].code}">复制</button>
                                <button class="e-update e-stop-mousedown sysPermission_update" data-id="${treeData[i].id}">修改</button>
                                <button class="e-delete e-stop-mousedown sysPermission_delete" data-id="${treeData[i].id}">删除</button>
                            </div>
                            ${treeData[i].name}(${treeData[i].code})
                        </div>
                        <js>
                            var level1=level+1;
                            forOut($(treeData[i].children),level1);
                        </js>
                    </li>
                </js-code>
            </ol>
        </js-code>
        <js>forOut(data.sysPermissionTree,0);</js>
    </div>
</div>

{{/index}}


{{#add}}
<div class="main-content">
    <div class="div-title">添加权限</div>
    <form class="data-form">
        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">权限名</label>

                    <div class="col-sm-7">
                        <input name="name" type="text" class="form-control data-param" required="required">
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">权限编码</label>

                    <div class="col-sm-7">
                        <input name="code" type="text" class="form-control data-param" required="required">
                    </div>
                </div>
            </div>
        </div>

        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">菜单</label>

                    <div class="col-sm-7">
                        <select class="form-control data-param" name="type">
                            <option value="0">权限</option>
                            <option value="1">权限(菜单)</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><a href="http://www.fontawesome.com.cn/faicons/" target="_blank">图标</a></label>

                    <div class="col-sm-7">
                        <input name="icon" type="text" class="form-control data-param">
                    </div>
                </div>
            </div>
        </div>


        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">页面路径</label>
                    <div class="col-sm-7">
                        <input name="path" type="text" class="form-control data-param">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12 center-action-div">
                <button class="btn btn-primary e-submit" type="button">提交</button>
                <button class="btn btn-primary e-go-index" type="button">返回</button>
            </div>
        </div>
    </form>
</div>
{{/add}}


{{#update}}
<div class="main-content">

    <div class="div-title">修改权限</div>
    <form class="data-form">
        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">权限名</label>

                    <div class="col-sm-7">
                        <input type="text" name="name" class="form-control data-param"
                               value="${data.sysPermission.name}" required="required">
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">权限编码(url)</label>

                    <div class="col-sm-7">
                        <input type="text" name="code" class="form-control data-param" required="required"
                               value="${data.sysPermission.code}">
                    </div>
                </div>
            </div>

        </div>

        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">菜单</label>

                    <div class="col-sm-7">
                        <select class="form-control data-param selected" name="type">
                            <option value="0">权限</option>
                            <option value="1">权限(菜单)</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><a href="http://www.fontawesome.com.cn/faicons/" target="_blank">图标</a></label>

                    <div class="col-sm-7">
                        <input name="icon" type="text" class="form-control data-param"
                               value="${data.sysPermission.icon}">
                    </div>
                </div>
            </div>
        </div>


        <div class="form-horizontal m-t">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">页面路径</label>
                    <div class="col-sm-7">
                        <input name="path" type="text" class="form-control data-param"
                               value="${data.sysPermission.path}">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12 center-action-div">
                <button class="btn btn-primary e-update" type="button">修改</button>
                <button class="btn btn-primary e-go-index" type="button">返回</button>
            </div>
        </div>
    </form>
</div>
{{/update}}
